import type { EquipmentClassification } from '@/types'

const controller = getAjaxBaseUrl('/equipmentDefinition', '/energy')

/** 获取定义信息数据 */
export function getDefinitionInfoByTypeKey(typeKey: string, classificationKey?: string) {
  return get<EquipmentClassification[]>(`${controller}/list`, {
    typeKey,
    classificationKey,
  })
}

/** 定义信息数据保存 */
export function saveDefinitionInfo(typeKey: string, data: EquipmentClassification[]) {
  return post(`${controller}/save`, {
    typeKey,
    classificationVoList: data,
  })
}
